﻿CREATE TABLE [dbo].[DomiciliosVendedores] (
    [IdDomicilioVendedor] INT          IDENTITY (1, 1) NOT NULL,
    [IdVendedor]          INT          NOT NULL,
    [IdTipoDomicilio]     TINYINT      NOT NULL,
    [IdBarrio]            INT          NOT NULL,
    [Calle]               VARCHAR (50) NOT NULL,
    [Numero]              VARCHAR (5)  NOT NULL,
    [Piso]                VARCHAR (2)  NOT NULL,
    [Departamento]        VARCHAR (2)  NOT NULL,
    CONSTRAINT [PK_DomiciliosVendedores] PRIMARY KEY CLUSTERED ([IdDomicilioVendedor] ASC),
    CONSTRAINT [FK_DomiciliosVendedores_Barrios] FOREIGN KEY ([IdBarrio]) REFERENCES [dbo].[Barrios] ([IdBarrio]),
    CONSTRAINT [FK_DomiciliosVendedores_TiposDomicilios] FOREIGN KEY ([IdTipoDomicilio]) REFERENCES [dbo].[TiposDomicilios] ([IdTipoDomicilio]),
    CONSTRAINT [FK_DomiciliosVendedores_Vendedores] FOREIGN KEY ([IdVendedor]) REFERENCES [dbo].[Vendedores] ([IdVendedor])
);

